<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>

  <div class="container-fluid ms-container has-ms-sidemenu">

    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">供方车辆申报审核</li>
    </ol>

    <div class="ms-content-layout has-operation">
    
      <div class="ms-operation-bar no-margin no-bottom-border clearfix">
        <div class="ms-operation-group ">
          <div class = "pull-left">
	          <a href="${ctx.host}/vehicle-declare-audits/batch-sign" data-target="#batch-sign" data-toggle="modal" class="btn ms-btn ms-btn-blue vehicle-batch-sign disabled">
	            <i class="glyphicon "></i>&nbsp;&nbsp;批量标记已同步
	          </a>
          </div>
          
          <div class = "pull-right">
	          <a href="${ctx.host}/vehicle-declare-audits/search" data-target="#search" data-toggle="modal" class="btn ms-btn ms-btn-blue">
	            <i class="glyphicon glyphicon-search"></i>过滤查询
	          </a>
	          <a href="${ctx.host}/vehicle-declare-audits/export" data-target="#export" data-toggle="modal" class="btn ms-btn ms-btn-blue vehicle-export">
              <i class="glyphicon "></i>导出
            </a>
          </div>
        </div>
      </div>
      
      <table class="table table-hover ms-table">
        <thead>
	        <tr>
	          <th><input type="checkbox" id="selectAll" /></th>
		        <th>序号</th>
		        <th>牵引车中文车牌号</th>
		        <th>挂车中文车牌号</th>
		        <th>所属公司代码</th>
		        <th>所属公司名称</th>
		        <th>申报时间</th>
		        <th>申报操作人</th>
		        <th>默认分区</th>
		        <th>车辆同步状态</th>
		        <th>是否同步TMS</th>
            <th>是否锁定</th>
		        <th class="text-center">操作</th>
	        </tr>
        </thead>

        <tbody>
          <c:forEach var="source" items="${vehicleSources}" varStatus="ordinal">
            <tr>  
              <td><input type="checkbox" name="vehicleId" value="${source.id}"/></td>
	            <td>${ordinal.count}</td>
	            <td>${source.tractorBrandCode}</td>
	            <td>${source.trailerBrandCode}</td>
	            <td>${source.organization.code}</td>
	            <td>${source.organization.name}</td>
	            <td>${source.declareTime}</td>
	            <td>${persist.user(source.lastOperator).name}</td>
	            <td>${empty source.supplier.branch ? '' : source.supplier.branch.name}</td>
	            <td>${source.status.description}</td>
	            <td>${source.synchronize ? '是' : '否'}</td>
              <td>${source.lock ? '是' : '否'}</td>
	            <td class="text-center">
	              <a href="${ctx.host}/vehicle-sources/${source.id}?vehicleMenuType=auditing">详情</a>&nbsp;&nbsp;
	              <a href="${ctx.host}/vehicle-declare-audits/${source.id}/sign" data-target="#sign" data-toggle="modal">标记已同步</a>&nbsp;&nbsp;
                <a href="${ctx.host}/vehicle-declare-audits/${source.id}/reject" data-target="#reject" data-toggle="modal">驳回</a>&nbsp;&nbsp;
	            </td>
	          </tr>          
          </c:forEach>
        </tbody>

        <tfoot>
	        <tr>
	          <td colspan="15" class="no-vertical-padding">
	            <div class="pull-left">
	              <jsp:include page="/WEB-INF/include/page.jsp">
	                <jsp:param name="url" value="vehicle-declare-audits"/>
	                <jsp:param name="queryString" value="${queryString}" />
                  <jsp:param name="perPage" value="true"/>
	              </jsp:include>
	            </div>
	          </td>
	        </tr>
        </tfoot>
        
      </table>

    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp" %>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/flow/vehicle-declare-audit-list.js"/>
  <script type="text/javascript">
    require(['page/supplier/flow/vehicle-declare-audit-list'], function (page) {
      page.init()
    })
  </script>

</body>
</html>